package zk.weart;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @Author zjk
 * @Description:
 * @Date 2022/5/10 23:46
 **/
@Slf4j
@SpringBootApplication
@EnableCaching
@EnableScheduling
@EnableSwagger2
public class BootStart {

    public static void main(String[] args) {
        System.setProperty("user.timezone", "GMT+8");
        ConfigurableApplicationContext application = SpringApplication.run(BootStart.class, args);
        Environment env = application.getEnvironment();
        String port = env.getProperty("server.port");
        String path = env.getProperty("server.servlet.context-path");
        log.info("\n----------------------------------------------------------\n" +
                "Application Village is running! Access URLs:\n" +
                "Local: http://localhost:" + port + path + "\n" +
                "API Local: \thttp://localhost:" + port + path + "doc.html \n" +
                "----------------------------------------------------------");
    }

}
